﻿using System;

namespace DataModel.Managers.SubManage
{
    public static class DayOfWeekExtension
    {
        /// <summary>
        /// Returns weekday number according to its number
        /// </summary>
        /// <param name="dayOfWeek"></param>
        /// <returns></returns>
        public static int ParseDayOfWeek(this DayOfWeek dayOfWeek)
        {
            int parsedDay = -1;
            switch (dayOfWeek)
            {
                case DayOfWeek.Monday: 
                    parsedDay = 1; 
                    break;
                case DayOfWeek.Thursday: 
                    parsedDay = 2; 
                    break;
                case DayOfWeek.Wednesday: 
                    parsedDay = 3;
                    break;
                case DayOfWeek.Tuesday: 
                    parsedDay = 4;
                    break;
                case DayOfWeek.Friday: 
                    parsedDay = 5;
                    break;
                case DayOfWeek.Saturday: 
                    parsedDay = 6;
                    break;
                case DayOfWeek.Sunday: 
                    parsedDay = 7;
                    break;
            }
            return parsedDay;
        }
    }
}